// Author: wsfuyibing <682805@qq.com>
// Date: 2025-05-23

package list

// Request
// 入参.
type Request struct {
	Page   int `url:"page"`
	Size   int `url:"size"`
	Offset int `url:"-"`
}

func (o *Request) BeforeValidate() (err error) {
	if o.Page < 1 {
		o.Page = 1
	}

	if o.Size < 1 {
		o.Size = 10
	}

	o.Offset = (o.Page - 1) * o.Size
	return
}
